{extend name="./main"}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/theme/default/css/login.css">
{/block}

{block name="body"}
<div class="login-container full-height">
    <!-- 页面表单主体 开始 -->
    <div class="container" style="top:50%;margin-top:-300px">
        <form onsubmit="return false;" data-time="0.001" data-auto="true" method="post"
              class="content layui-form animated fadeInDown">
            <div class="l-banner">
                <img src="__STATIC__/theme/default/img/login/sweet.png" alt="">
            </div>
            <div class="login-logo">
                <img src="__STATIC__/theme/default/img/login/logo.png" alt="">
            </div>
            <ul>
                <li>
                    <input name='username' class="hide"/>
                    <input required="required" pattern="^\S{4,}$" value="" name="username"
                           autofocus="autofocus" autocomplete="off" class="login-input username"
                           title="请输入4位及以上的字符" placeholder="请输入用户名/手机号码"/>
                </li>
                <li>
                    <input name='password' class="hide"/>
                    <input required="required" pattern="^\S{4,}$" value="" name="password"
                           type="password" autocomplete="off" class="login-input password"
                           title="请输入4位及以上的字符" placeholder="请输入密码"/>
                </li>
                <li>
                    <input name='captcha' class="hide"/>
                    <input  pattern="^\S{4,}$" value="" name="code"
                           type="text" autocomplete="off" class="login-input captcha"
                           title="请输入验证码" placeholder="请输入验证码"/>
                    <img src="{:url("admin/login/verifycode",['t'=>time()])}" title="点击更换" alt="captcha" class="captcha_img" id="captcha_img" onclick="changeCode()" style="z-index:9999"/>
                    <div style="clear:both"></div>
                </li>
                <li class="text-center">
                    <button type="submit" class="layui-btn layui-disabled ivu-btn" data-form-loaded="立 即 登 入">正 在 载 入</button>
                </li>
            </ul>
        </form>
    </div>
    <!-- 页面表单主体 结束 -->

    <!-- 底部版权信息 开始 -->
    {if sysconf('site_copy')}
    <div class="footer notselect">copyright © 2021 <a href="https://www.thinkct.net/" target="_blank" style="color:#FFF;">ThinkCT</a> all rights reserved.</div>
    {/if}
    <!-- 底部版本信息 结束 -->

</div>
{/block}

{block name="script"}
<script>
    if (window.location.href.indexOf('#') > -1) {
        window.location.href = window.location.href.split('#')[0];
    }
    require(['jquery'], function ($) {
        $('[name="password"]').on('focus', function () {
            $('#left-hander').removeClass('initial_left_hand').addClass('left_hand');
            $('#right-hander').removeClass('initial_right_hand').addClass('right_hand')
        }).on('blur', function () {
            $('#left-hander').addClass('initial_left_hand').removeClass('left_hand');
            $('#right-hander').addClass('initial_right_hand').removeClass('right_hand')
        });
    });
    function changeCode() {
        $("#captcha_img").attr("src",'{:url("admin/login/verifycode")}?t='+new Date().getTime()+parseInt(40*Math.random()));
    };
</script>
{/block}